//
//  SHKViewController.m
//  YsToolsManager
//
//  Created by 139994824@qq.com on 03/20/2020.
//  Copyright (c) 2020 139994824@qq.com. All rights reserved.
//

#define SemaphoreBegin \
static dispatch_semaphore_t semaphore; \
static dispatch_once_t onceToken; \
dispatch_once(&onceToken, ^{ \
    semaphore = dispatch_semaphore_create(1); \
}); \
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);

#define SemaphoreEnd \
dispatch_semaphore_signal(semaphore);



#import "SHKViewController.h"
//#import <ReactiveObjC/ReactiveObjC.h>
//#import <Aspects/Aspects.h>
//#import <YYModel/YYModel.h>
#import "HLEPanelConfigurationModel.h"
//#import <MBProgressHUD/MBProgressHUD.h>
#import <YYCategories/YYCategories.h>
#import <Masonry/Masonry.h>
#import "SHKViewController11.h"
#import "SHKPerson.h"
#import <MJExtension/MJExtension.h>

//#import <YYText/YYText.h>

@interface SHKViewController ()
@property(nonatomic, strong) NSMutableArray *dataSoruce;
@end

@implementation SHKViewController


- (void)archive
{
    SHKPerson *songhongkang = SHKPerson.new;
    songhongkang.name = @"songhongkang";
    songhongkang.age = 27;
    songhongkang.height = 165;
    
    NSString *path  = [YsToolsManagerFileUtil createFile:[YsToolsManagerFileUtil.getDocumentsPath stringByAppendingPathComponent:@"songhongkang"] fileName:@"hhh.archiver"];
    [NSKeyedArchiver archiveRootObject:songhongkang toFile:path];
    
}

- (void)unArchive
{
    NSString *path  = [YsToolsManagerFileUtil createFile:[YsToolsManagerFileUtil.getDocumentsPath stringByAppendingPathComponent:@"songhongkang"] fileName:@"hhh.archiver"];
    SHKPerson *person =   [NSKeyedUnarchiver unarchiveObjectWithFile:path];
    
    NSLog(@"%@",person);
}

- (void)mj
{
    NSDictionary *dict = @{@"name":@"宋鸿康",
                           @"age":@27,
                           @"height":@165
    };
    SHKPerson *user = [SHKPerson mj_objectWithKeyValues:dict];
    NSLog(@"%@",user);
}

- (void)btnClick:(UIButton *)btn
{
    NSLog(@"=========");
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    HLEExpandButton *btn= [HLEExpandButton buttonWithType:UIButtonTypeCustom];
    [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
//    btn.expand = 100;
//    btn.center = self.view.center;
//    btn.size = CGSizeMake(200, 100);
    btn.backgroundColor = UIColor.purpleColor;
    [btn setImage:[UIImage imageNamed:@"dribbble64_imageio"] forState:0];
    [btn setTitle:@"song" forState:UIControlStateNormal];
    [btn hle_setPosition:ImagePositionTop];
    [self.view addSubview:btn];
    [btn hle_setSpacing:0 padding:0];

    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(0);
    }];
    
        
    
   
}





//
//- (void) showToast: (NSString *)string{
//    UIWindow *kKeyWindow = [UIApplication sharedApplication] . keyWindow;
//    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo: kKeyWindow animated:YES] ;hud. mode = MBProgressHUDModeText;
//    hud.offset = CGPointMake(0, kScreenHeight * 0.3);
//    hud.removeFromSuperViewOnHide = YES ;
//    hud . bezelView. backgroundColor = [[UIColor colorWithHexString:@"0x000000"]
//                                        colorWithAlphaComponent:0.6];
//    hud . margin = 15;
//
//    hud. detailsLabel.text = string;
//
//    hud . detailsLabel. textColor = [UIColor whiteColor] ;
//    [hud hideAnimated:YES afterDelay:100];
//
//}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
   
    [HLELogFileManager writeString:@"11111"];
//    [MBProgressHUD hideHUDForView:self.view animated:YES];

//    HLEEndLoading(nil)
//    [self.navigationController pushViewController:SHKViewController11.new animated:YES];
//    self.view make
}
@end
